import type { CardDetail, CardListData, CardListParams, formCardData } from '@/types/card';
import { request } from '@/utils/reuqest';

export const getCardListAPI=(params:CardListParams)=>{
  return request<CardListData>('/parking/card/list',"GET",params)
}

export const addCardAPI=(data:formCardData)=>{
  return request('/parking/card',"POST",data)
}
/**
 * 获取月卡详情
 * @data
 * @returns
 */
export const  getCardDetailAPI = (id: string) => {
  return request<CardDetail>(`/parking/card/detail/${id}`, 'GET')
}
/**
 * 删除月卡
 * @param {*} id
 * @returns
 */
export const delCardAPI = (id: string) => {
  return request(`/parking/card/${id}`, 'DELETE')
}
/**
 * 更新月卡
 * @param {*} data
 * @returns
 */
export const updateCardAPI = (data: formCardData) => {
  return request('/parking/card/edit', 'PUT', data)
}